<?php
include "head_lv2.php";
if($b_no = $_GET['b_no']){
	$query = "select * from uatp_middlecategory where b_no='$b_no';";
	$result = DBquery($query);
	$total = "<option value='-1'>:: 중분류 선택 ::</option>";
	while($row = mysql_fetch_array($result)){
		$total .= "<option value=$row[no]>$row[name]</option>";
	}
	if($b_no=='-1'){
		$total = "<option value='-1'>:: 중분류 선택 ::</option>";		
	}
	echo $total;
}

if($m_no = $_GET['m_no']){
	$query = "select * from uatp_smallcategory where m_no='$m_no';";
	$result = DBquery($query);
	$total = "<option value=''>:: 소분류 선택 ::</option>";
	while($row = mysql_fetch_array($result)){
		$total .= "<option value=$row[no]>$row[name]</option>";
	}
	if($m_no=='-1'){
		$total = "<option value='-1'>:: 소분류 선택 ::</option>";
	}
	echo $total;
}
?>